🧑💻 Какие методы есть у генератора, но нет у итератора?
1️⃣send(value) Позволяет передать значение внутрь генератора. Это значение становится результатом выражения yield в теле генератора.
2️⃣throw(type, value=None, traceback=None) Используется для выбрасывания исключения внутри генератора в точке последнего yield. Позволяет обрабатывать ошибки.
3️⃣close() Завершает выполнение генератора, вызывая исключение GeneratorExit. Обычно используется для освобождения ресурсов.
🧑💻 Какие методы есть у генератора, но нет у итератора?
1️⃣send(value) Позволяет передать значение внутрь генератора. Это значение становится результатом выражения yield в теле генератора.
2️⃣throw(type, value=None, traceback=None) Используется для выбрасывания исключения внутри генератора в точке последнего yield. Позволяет обрабатывать ошибки.
3️⃣close() Завершает выполнение генератора, вызывая исключение GeneratorExit. Обычно используется для освобождения ресурсов.
#вопросы_с_собеседований
BY Python tests
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Launched in 2013, Telegram allows users to broadcast messages to a following via “channels”, or create public and private groups that are simple for others to access. Users can also send and receive large data files, including text and zip files, directly via the app.The platform said it has more than 500m active users, and topped 1bn downloads in August, according to data from SensorTower.
Telegram announces Search Filters
With the help of the Search Filters option, users can now filter search results by type. They can do that by using the new tabs: Media, Links, Files and others. Searches can be done based on the particular time period like by typing in the date or even “Yesterday”. If users type in the name of a person, group, channel or bot, an extra filter will be applied to the searches.